#ifndef __RED_TRACE_OBJECT_H__
#define __RED_TRACE_OBJECT_H__

#include "redobject.h"

typedef struct _RedTraceObject
{
	RedObject_HEAD

	RedObject	*tr_line;
	RedObject	*tr_fname;
	RedObject	*tr_module;

	int			 tr_lineno;
	int			 tr_position;
} RedTraceObject;

RED_EXPORT extern RedTypeObject RedType_Trace;

#define RedTrace_Exact(o)		((o)->ob_type == &RedType_Trace)

#define RedTrace_Line(o)		(((RedTraceObject *)(o))->tr_line)
#define RedTrace_Fname(o)		(((RedTraceObject *)(o))->tr_fname)
#define RedTrace_Module(o)		(((RedTraceObject *)(o))->tr_module)

#define RedTrace_LineNo(o)		(((RedTraceObject *)(o))->tr_lineno)
#define RedTrace_Position(o)	(((RedTraceObject *)(o))->tr_position)

RED_EXPORT RedObject *RedTrace_Traceback(int lineno, int position, RedObject *line, RedObject *fname, RedObject *module);

#endif /* __RED_TRACE_OBJECT_H__ */
